<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="/styles/general.css"/>
<link rel="stylesheet" type="text/css" href="/styles/main.css"/>
<link rel="stylesheet" type="text/css" href="/styles/pager.css"/>
<script src="/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="/js/jquery.jeditable.mini.js" type="text/javascript"></script> 
<script src="/js/jquery.pager.js" type="text/javascript"></script> 
<script type="text/javascript" language="javascript"> 
jQuery.extend({
	toArr:function(ojson){
		var arr = []; 
		for(pro in ojson) arr.push(pro); 
		return arr;
	},
	createconfig:function() {
		$.ajax({
	        url:"/static/config/",
	        cache: false,
	        success: function(html){
				$("#divtablelist").html("<a target='_blank' href='"+html+"'>"+html+"</a><br>");
	        }
	    });
	},
	createbest:function(){
		typeid = json["id"];
		qb=encodeURIComponent("全部");
		$.ajax({
	        url:"/static/best/tag1/"+qb+"/tag2/"+qb+"/tag3/"+qb+"/typeid/"+typeid,
	        cache: false,
	        success: function(html){
				$("#divtablelist").prepend("<a target='_blank' href='"+html+"'>"+html+"</a><br>");
				$("#divtablelist").prepend("生成完毕<br>");
		    }
	    });
	},
	next:function(){
		if(index3>=tags3.length){
			index2++;
			index3=0;
		}
		if(index2>=tags2.length){
			index1++;
			index2=0;
		}
		if(index1>=tags1.length){
			$.createbest();
			//$("#divtablelist").prepend("生成完毕<br>");
			return;
		}
		typeid = json["id"];
		t1=tags1[index1];
		t2=tags2[index2];
		t3=tags3[index3];
		$.ajax({
	        url:"/static/list/typeid/"+typeid+"/tag1/"+encodeURIComponent(t1)+"/tag2/"+encodeURIComponent(t2)+"/tag3/"+encodeURIComponent(t3)+"/",
	        cache: false,
	        success: function(html){
				$("#divtablelist").prepend("<a target='_blank' href='"+html+"'>"+html+"</a><br>");
				$.next();
	        }
	    });
		index3++;		
	}
});
var json={$info};
var obj=null;
var t=null;	
var index1=0;
var index2=0;
var index3=0;
var typeid;
var tags1;
var tags2;
var tags3;
$(document).ready(function() {	
	if(!json)return;
	if(!json["tag1"])return;
	tags1=$.toArr(json["tag1"]["tagdetail"]);
	tags2=$.toArr(json["tag2"]["tagdetail"]);
	tags3=$.toArr(json["tag3"]["tagdetail"]);
	$("#divtablelist").prepend("开始生成文件<br>");
	$.next();
});
</script>
</head>
<body >
<h1>
<span class="action-span1">生成列表页</span>
<div style="clear:both"></div>
</h1>
<div class="form-div">
	<a href="#" onclick="$.createconfig();return false;">首页</a> | 
	{loop $typeInfos $k $v}
		<a href="/static/createlist/typeid/{$v['id']}">{$v["typename"]}</a> | 
	{/loop}
</div>
<div id='divtablelist'>

</div>
<div id="pager" style='align:center;' /></div>
<div style="clear:both"></div>
{template 'footer.html'}
</body>
</html>
